/**
 * Created by shaoting on 16/10/17.
 */
import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    ListView,
    Image,
    TouchableOpacity,
    Platform,
    ScrollView,
    Dimensions,
} from 'react-native';

var NavigatorBar = require('../Main/NXNavigationBar') //NavigationBar
var DetailsTopView = require('../Mine/NXDetailsTopView')
var DetailsMiddleView = require('../Mine/NXDetailsMiddleView')
var DetailsBottomView = require('../Mine/NXDetailsBottomView')
var DetailsWebView =require('../Mine/NXDetailsWebView')

var {width,height} = Dimensions.get('window').height; //屏宽
var DetailsView = React.createClass({
    render() {
        return (
            <View style={styles.container}>
                <NavigatorBar title='详情'  widthWH={Platform.OS == 'ios' ? 15:15} leftBtnName = 'return_icon' rightBtnName = 'Share_icon' leftpress={()=>this.leftAction()} rightPress={()=>this.rightAction()}  />
                <ScrollView
                    style={styles.scrollviewStyle}
                    showsHorizontalScrollIndicator={false}
                    showsVerticalScrollIndicator={false}
                >
                    {/*上部的view*/ }
                    <DetailsTopView product_id = {this.props.product_id} uploadImgId = {this.props.uploadImgId}/>
                    {/*中间的view*/}
                    <DetailsMiddleView product_id = {this.props.product_id} uploadImgId = {this.props.uploadImgId}/>
                    {/*下边的View*/}
                    <DetailsBottomView detailsBottomCellAction={this.bottomCellAction}/>
                </ScrollView>
            </View>
        );
    },
    bottomCellAction(){
        this.props.navigator.push({
            component:DetailsWebView,
            passProps:{
                'articleid':'PA-5ca419d7-d105-41ef-bae9-2588a93e16c5'
            }
        })
    },
    leftAction(){
        this.props.navigator.pop({

            }
        );
    },
    rightAction(){
        // alert('右');
        alert(uploadProductName)
    }
});


var styles = StyleSheet.create({
    container: {
        flex:1,
        backgroundColor: '#F5FCFF',
    },
    scrollviewStyle:{

    }

});

module.exports = DetailsView;